package hezi.server;

import java.sql.SQLException;
import java.sql.Statement;

import javax.xml.parsers.FactoryConfigurationError;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

import org.apache.log4j.Logger;
import org.apache.log4j.xml.DOMConfigurator;

import dz.common.DBHelper;

public class SelfTest {
	public static Logger logger = Logger.getLogger("");

	public static void main(String[] args) {
		DOMConfigurator.configure("C:\\hezi2\\common\\log4j.xml");
		
//		JSONTest();
		
//		dbtest();	
	}

	private static void JSONTest() {
		JSONObject baba = new JSONObject();
		baba.put("id", "0");
		baba.put("name", "zhonghua");
		
		JSONObject shuke = new JSONObject();
		shuke.put("id", "1");
		shuke.put("name", "shuke");
		
		JSONObject beita = new JSONObject();
		beita.put("id", "1");
		beita.put("name", "beita");

		JSONArray array = new JSONArray();
		array.add(shuke);
		array.add(beita);
		
		baba.put("sons", array);
		
		String str = baba.toString();
		JSONObject o2 = JSONObject.fromObject(str);
		
		logger.info(o2.toString());
	}


	
}
